<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../ht-css/Project.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../ht-css/style-q.css" />
    <title>临采商品详情</title>
    <style>.icon-Star{
        color:red;
    }
    html {
        zoom: .98
    }
    </style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页  <span class="c-gray en">&gt;</span>商品管理<span class="c-gray en">&gt;</span> 临采商品详情<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<article class="page-container">
    <form class="ml-20 mr-20" method="post">
        <div class="bg-1 bk-gray pd-20 mb-20">
            <div style="height:60px;border-top:none;border-bottom:1px dashed #D3D3D3;">
                <div class="lh-24 mt-20 pl-10 f-20" style="display:inline-block;width:120px;color:#333;border-left:4px solid #498FE2;"><strong>图片信息</strong></div>
            </div>
            <div class="line"></div>
            <div class="mt-15 mb-30 imgTable clearfix">
                <ul class="imgboxUl f-l">

                </ul>
                <ul class="f-l ml-5 addSpuImgbox">
                    <li class="col-5-1 text-c va-t">
                            <span id="addSpuImg" class="spu_add_img">

                            </span>
                    </li>
                </ul>
            </div>
            <!--基本信息-->
            <div style="height:60px;border-top:none;border-bottom:1px dashed #D3D3D3;">
                <div class="lh-24 mt-20 pl-10 f-20" style="display:inline-block;width:120px;color:#333;border-left:4px solid #498FE2;"><strong>基本信息</strong></div>
            </div>
            <div style="overflow: hidden;">
            <div class="pt-20 pl-20 pr-20 f-l" style="display: inline-block;width:45%;">
                <table class="text-c lh-26">
                    <tr>
                        <td class="bk-gray w-80">Code码</td>
                        <td class="bk-gray w-300" id="code">01.02.99.0000001</td>
                    </tr>
                    <tr>
                        <td class="bk-gray w-80">商品名称</td>
                        <td class="bk-gray w-300 text-r">
                            <a class="text-c f-r edit_name" style="width:14.5%;">编辑</a>
                            <span class="f-r text-c" style="width: 71%;" id="skuName"></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="bk-gray w-80">规格名称</td>
                        <td class="bk-gray w-300 text-r">
                            <a class="text-c f-r edit_specifications" style="width:14.5%;">编辑</a>
                            <span class="f-r text-c" style="width: 71%;" id="specifications"></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="bk-gray w-80">所属分类</td>
                        <td class="bk-gray w-300" id="category">一级名称>二级名称>三级名称</td>
                    </tr>
                </table>
            </div>
            <div class="pt-20 pl-20 pr-20 f-l" style="display: inline-block;width:45%;">
                <table class="text-c lh-26 base-info">
                    <tr>
                        <!--<td class="bk-gray w-80">Code码</td>
                        <td class="bk-gray w-300" id="code">01.02.99.0000001</td>-->
                    </tr>
                    <tr>
                        <td class="bk-gray w-80">原商品名称</td>
                        <td class="bk-gray w-300"><span id="oldSkuName">BV塑铜线BV塑铜线BV塑铜线BV塑铜线BV塑铜线BV塑铜线</span></td>
                    </tr>
                    <tr>
                        <td class="bk-gray w-80">原规格名称</td>
                        <td class="bk-gray w-300" id="oldSpecifications">红色 1.5 平</td>
                    </tr>
                    <!-- <tr>
                        <td class="bk-gray w-80">原所属分类</td>
                        <td class="bk-gray w-300" id="oldCategory">一级名称>二级名称>三级名称</td>
                    </tr> -->
                </table>
            </div>
            </div>
            <div class="pd-20 mb-20">
                <table>
                    <tr>
                        <td class="col-3-1 text-l">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-60 lh-26">品牌：</label>
                                <div class="formControls w-200 ml-10 lh-26" id="brand">熊猫</div>
                            </div>
                        </td>

                        <td class="col-3-1 text-l">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-100 lh-26">单位：</label>
                                <div class="formControls w-200 ml-10 lh-26" id="unit">米</div>
                            </div>
                        </td>
                        <td class="col-3-1 text-l">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-60 lh-26">询价客户：</label>
                                <div class="formControls w-200 ml-10 lh-26" id="customerName" style="overflow: hidden;white-space: nowrap;text-overflow:ellipsis;">中铁一局中铁一局中铁一局中铁一局中铁一局中铁一局中铁一局</div>
                                <div id="mouseBoxCus" style="position:absolute;left: 200px; background: #fff;padding:10px;border:1px solid #ccc;display:none;"></div>
                            </div>
                        </td>
                    </tr>

                </table>
            </div>

            <!--售卖信息-->
            <div style="height:60px;border-top:none;border-bottom:1px dashed #D3D3D3;">
                <div class="lh-24 mt-20 pl-10 f-20" style="display:inline-block;width:120px;color:#333;border-left:4px solid #498FE2;"><strong>售卖信息</strong></div>
            </div>
            <div class="pt-20 pl-20 pr-20" style="width:50%;">
                <table class="text-c lh-26">
                    <tr style="background:#ececec;">
                        <td class="bk-gray" style="width:50%;">成本价</td>
                        <td class="bk-gray" style="width:50%;">VIP价</td>
                    </tr>
                    <tr>
                        <td class="bk-gray" style="width:50%;" id="costPrice">20.89 元/米</td>
                        <td class="bk-gray" style="width:50%;" id="vipPrice">25.00 元/米</td>
                    </tr>
                </table>
            </div>
            <div class="pd-20">
                <table>
                    <tr>
               
                        <td class="col-3-1 text-l">
                            <div class="row ml-10">
                                <label class="form-label f-l text-r w-75 lh-26">到货周期：</label>
                                <div class="formControls w-200 ml-10 lh-26" id="arrivalCycle">3天</div>
                            </div>
                        </td>
                        <td class="col-3-1 text-l">
                            <div class="row ml-10">
                                <input id="skucode" style="display: none">
                                <label class="form-label f-l text-r w-60 lh-26" style="width: 72px;">最小起售量：</label>
                                <span style="margin-left: 1px;" class="formControls w-200 ml-10 lh-26" id="miniOrder">1</span> <a class="edit_miniOrder">编辑</a>

                            </div>
                        </td>
                    </tr>

                </table>

                <div style="height:60px;border-top:none;border-bottom:1px dashed #D3D3D3;">
                    <div class="lh-24 mt-20 pl-10 f-20" style="display:inline-block;width:120px;color:#333;border-left:4px solid #498FE2;"><strong>详情信息</strong></div>
                </div>
                <div class="line"></div>
                <div class="pd-20">
                    <script id="editor" type="text/plain" style="width: 100%; height: 500px"></script></div>
            </div>

            <div class="text-c pt-30 pb-20">
                <input type="button" class="btn btn-secondary radius size-S" onclick="makeSure()" value="确&nbsp;&nbsp;认">
                <input name="" type="reset" onclick="resetform()" class="btn radius size-S ml-10" value="取&nbsp;&nbsp;消">
            </div>


        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../ht-js/Project.js?rev=@@hash"></script>
<script src="../../ht-js/goods/procureGoodsManageDetail.js?rev=@@hash"></script>
<script src="../../ht-js/timeFormat.js?rev=@@hash"></script>
<script src="../../ht-js/goods/pictures.js?rev=@@hash"></script>
<!--富文本编辑器-->
<script type="text/javascript" charset="utf-8" src="../../lib/ueditor/1.4.3/ueditor.config.js?rev=@@hash"></script>
<script type="text/javascript" charset="utf-8" src="../../lib/ueditor/1.4.3/ueditor.all.min.js?rev=@@hash"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../../lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js?rev=@@hash"></script>
<script>
    $(function(){
        $(".edit_name").click(function () {
            layer.open({
                type: 1,
                // skin: 'layui-layer-rim', //加上边框
                title:'商品名称编辑', //标题
                area: ['320px', '230px'], //宽高
                content: '<textarea id="edit_name" maxlength="100" style="width:275px;height:85px;margin-left:20px;margin-top:20px;"/>' +
                '<div class="text-c pb-10 pt-15">' +
                '<input type="reset" onclick="closeLayer()" class="btn radius size-S mr-10" value="取&nbsp;&nbsp;消">' +
                '<input type="button" onclick="edit(\'edit_name\', \'skuName\')" class="btn btn-secondary radius size-S" value="确&nbsp;&nbsp;定">' +
                '</div>'
            });
            $("#edit_name").val($("#skuName").html());
        })
        $(".edit_specifications").click(function () {
            layer.open({
                type: 1,
                // skin: 'layui-layer-rim', //加上边框
                title:'规格名称编辑', //标题
                area: ['320px', '230px'], //宽高
                content: '<textarea id="edit_specifications" maxlength="100" style="width:275px;height:85px;margin-left:20px;margin-top:20px;"/>' +
                '<div class="text-c pb-10 pt-15">' +
                '<input type="reset" onclick="closeLayer()" class="btn radius size-S mr-10" value="取&nbsp;&nbsp;消">' +
                '<input type="button" onclick="edit(\'edit_specifications\', \'specifications\')" class="btn btn-secondary radius size-S" value="确&nbsp;&nbsp;定">' +
                '</div>'
            });
            $("#edit_specifications").val($("#specifications").html());
        })
    })
    $(".edit_miniOrder").click(function () {
        layer.open({
            type: 1,
            // skin: 'layui-layer-rim', //加上边框
            title:'最小起订量编辑', //标题
            area: ['320px', '230px'], //宽高
            content: '<textarea id="edit_miniOrder" maxlength="100" onkeyup="value=value.replace(/^(0+)|[^\\d]+/g,\'\')"  oninput = "value=value.replace(/[^\\d]/g,\'\')" style="width:275px;height:85px;margin-left:20px;margin-top:20px;"/>' +
                '<div class="text-c pb-10 pt-15">' +
                '<input type="reset" onclick="closeLayer()" class="btn radius size-S mr-10" value="取&nbsp;&nbsp;消">' +
                '<input type="button" onclick="edit(\'edit_miniOrder\', \'miniOrder\')" class="btn btn-secondary radius size-S" value="确&nbsp;&nbsp;定">' +
                '</div>'
        });
        $("#edit_miniOrder").val($("#miniOrder").html());
    })


    function edit(newId, oldId) {
        $("#" + oldId).html($("#" + newId).val());
        layer.closeAll();
    }

    function closeLayer() {
        layer.closeAll();
    }

    function resetform() {
        layer.confirm('确认要取消吗？',function(index){
            layer.msg('已取消', {
                icon: 1,
                time: 1000 //2秒关闭（如果不配置，默认是3秒）
            }, function(){
                parent.layer.closeAll();
            });
        });
    }


    var skuFormData = new FormData();
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor',{
        toolbars: [
            [
                'source', //源代码
                'anchor', //锚点
                'undo', //撤销
                'redo', //重做
                'bold', //加粗
                'indent', //首行缩进
                // 'snapscreen', //截图
                'italic', //斜体
                'underline', //下划线
                'strikethrough', //删除线
                'subscript', //下标
                'fontborder', //字符边框
                'superscript', //上标
                'formatmatch', //格式刷

                'blockquote', //引用
                'pasteplain', //纯文本粘贴模式
                'selectall', //全选
                'print', //打印
                'preview', //预览
                'horizontal', //分隔线
                'removeformat', //清除格式
                'time', //时间
                'date', //日期
                'unlink', //取消链接
                'insertrow', //前插入行
                'insertcol', //前插入列
                'mergeright', //右合并单元格
                'mergedown', //下合并单元格
                'deleterow', //删除行
                'deletecol', //删除列
                'splittorows', //拆分成行
                'splittocols', //拆分成列
                'splittocells', //完全拆分单元格
                'deletecaption', //删除表格标题
                'inserttitle', //插入标题
                'mergecells', //合并多个单元格
                'deletetable', //删除表格
                'cleardoc', //清空文档
                'insertparagraphbeforetable', //”表格前插入行”
                'insertcode', //代码语言
                'fontfamily', //字体
                'fontsize', //字号
                'paragraph', //段落格式
                /*'simpleupload', //单图上传
                'insertimage', //多图上传*/
                'edittable', //表格属性
                'edittd', //单元格属性
                'link', //超链接
                'emotion', //表情
                'spechars', //特殊字符
                'searchreplace', //查询替换
                'map', //Baidu地图
                'gmap', //Google地图
                'insertvideo', //视频
                'help', //帮助
                'justifyleft', //居左对齐
                'justifyright', //居右对齐
                'justifycenter', //居中对齐
                'justifyjustify', //两端对齐
                'forecolor', //字体颜色
                'backcolor', //背景色
                'insertorderedlist', //有序列表
                'insertunorderedlist', //无序列表
                'fullscreen', //全屏
                'directionalityltr', //从左向右输入
                'directionalityrtl', //从右向左输入
                'rowspacingtop', //段前距
                'rowspacingbottom', //段后距
                'pagebreak', //分页
                'insertframe', //插入Iframe
                'imagenone', //默认
                'imageleft', //左浮动
                'imageright', //右浮动
                // 'attachment', //附件
                'imagecenter', //居中
                'wordimage', //图片转存
                'lineheight', //行间距
                'edittip ', //编辑提示
                'customstyle', //自定义标题
                'autotypeset', //自动排版
                'webapp', //百度应用
                'touppercase', //字母大写
                'tolowercase', //字母小写
                'background', //背景
                'template', //模板
                'scrawl', //涂鸦
                'music', //音乐
                'inserttable', //插入表格
                'drafts', // 从草稿箱加载
                // 'charts', // 图表
            ]
        ]
    });
    UE.registerUI('dialog',function(editor,uiName){
            sessionStorage.setItem("skuOrSpu", "spu");
            //创建dialog
            var dialog = new UE.ui.Dialog({
                //指定弹出层中页面的路径，这里只能支持页面,因为跟addCustomizeDialog.js相同目录，所以无需加路径
                iframeUrl:'procurespuPictures.html',
                //需要指定当前的编辑器实例
                editor:editor,
                //指定dialog的名字
                name:uiName,
                //dialog的标题
                title:"请选择图片",
                //指定dialog的外围样式
                cssRules:"width:1366px;height:500px;",
                //如果给出了buttons就代表dialog有确定和取消
                buttons:[
                    {
                        className:'edui-okbutton',
                        label:'确定',
                        onclick:function () {
                            var selectNum = sessionStorage.getItem("selectNum");
                            console.log(selectNum)
                            if (selectNum != null) {
                                var selectPic = JSON.parse(sessionStorage.getItem("selectPic"));
                                var value = "";
                                for (var i = 0; i < selectPic.length; i++) {
                                    value += "<img src='" + selectPic[i] + "'>"
                                }
                                UE.getEditor('editor').execCommand('insertHtml', value)
                                sessionStorage.removeItem("selectNum");
                                sessionStorage.removeItem("selectPic");
                                dialog.close(true);
                            } else {
                                img.show();
                                if(skuFormData != null){
                                    if (sessionStorage.getItem("imgFileList") == 0) {
                                        layer.msg("请选择图片！", {icon: 5,time: 2000});
                                        return false;
                                    }
                                    $.ajax({
                                        url: root.goodsInter.goods_saveDetailImages,
                                        cache: false,  //禁用缓存
                                        type: "POST",
                                        // 告诉jQuery不要去处理发送的数据
                                        processData: false,
                                        // 告诉jQuery不要去设置Content-Type请求头
                                        contentType: false,
                                        data: skuFormData,
                                        success: function (data) {
                                            if (data.errorCode == 0) {
                                                img.hide();
                                                for(var i = 0; i < data.imgList.length; i++){
                                                    var value = "<img src='" + data.imgList[i] + "'>";
                                                    UE.getEditor('editor').execCommand('insertHtml', value)
                                                }
                                                dialog.close(true);
                                            }
                                        }
                                    });
                                }
                            }

                        }
                    },
                    {
                        className:'edui-cancelbutton',
                        label:'取消',
                        onclick:function () {
                            sessionStorage.removeItem("selectNum");
                            sessionStorage.removeItem("selectPic");
                            dialog.close(false);
                        }
                    }
                ]});

            //参考addCustomizeButton.js
            var btn = new UE.ui.Button({
                name:'上传图片',
                title:'上传图片',
                //需要添加的额外样式，指定icon图标，这里默认使用一个重复的icon
                cssRules :'background-position: -726px -77px;',
                onclick:function () {
                    //渲染dialog
                    dialog.render();
                    dialog.open();
                }
            });

            return btn;
        }
        /*index 指定添加到工具栏上的那个位置，默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的，默认是页面上所有的编辑器都会添加这个按钮*/);

</script>
</body>
</html>